<template>
    <el-dialog :model-value="dialogVisible" title="添加支付方式" width="30%" center :destroy-on-close="true"
        @close="emits('closeDialog')">

        <el-form :model="form" width="100%" label-width="120px" ref="dialogFormRef">
            <!-- <el-form-item>
                <el-radio v-model="radio" label="1">企业账户</el-radio>
                <el-radio v-model="radio0" label="2">个人账户</el-radio>
            </el-form-item> -->
            <el-form-item label="银行卡ID">
                <el-input v-model="form.card_id" placeholder="银行卡ID" clearable />
            </el-form-item>
            <el-form-item label="收款人姓名">
                <el-input v-model="form.amount" placeholder="收款人姓名" clearable />
            </el-form-item>
            <el-form-item label="银行账号">
                <el-input v-model="form.amount" placeholder="银行账号" clearable />
            </el-form-item>
            <el-form-item label="银行名称">
                <el-input v-model="form.amount" placeholder="银行名称" clearable />
            </el-form-item>
            <el-form-item label="银行地址">
                <el-input v-model="form.amount" placeholder="银行地址" clearable />
            </el-form-item>
            <el-form-item label="SWIFT/BIC">
                <el-input v-model="form.amount" placeholder="SWIFT/BIC" clearable />
            </el-form-item>
        </el-form>
        <div class="w-full flex justify-center mt-5">
            <el-button type="primary" class="w-32">新增收款账户</el-button>
            <el-button type="primary" class="w-32" @click="submit(form)">提交付款</el-button>
        </div>
    </el-dialog>
</template>
<script setup>
import { ref, reactive } from "vue";
const form = reactive({
    currency: "",
    amount: "",
    user_kyc_id: "",
    bank_card_id: "",
});
const dialogFormRef = ref("");
defineProps({
    dialogVisible: {
        type: Boolean,
        default: false,
    },
    currencyList: {
        type: Array,
        default: [],
    },
    userKycIdList: {
        type: Array,
        default: [],
    },
    bankCardIdList: {
        type: Array,
        default: [],
    },
});

const emits = defineEmits(["closeDialog", "submitForm", "handleUserKycChange"]);

const handleUserKycChange = (value) => {
    emits("handleUserKycChange", value);
};
const submit = (dialogForm) => {
    console.log("提交参数----", dialogForm);
    dialogFormRef.value
        .validate()
        .then(async () => {
            try {
                const param = Object.assign({}, dialogForm);
                emits("submitForm", param);
            } catch (error) {
                console.log(error);
            }
        })
        .catch((error) => {
            console.log(error);
        });
};
</script>
  